<%@ page contentType="text/html;charset=utf-8" %>
<%@ page import="java.util.*"%>
<%@ page import="com.zll.framework.util.*" %>
<%
	HashMap map	= (HashMap)request.getAttribute("result");


	String result	= StringUtil.nvl(map.get("result"));
	String message	= StringUtil.nvl(map.get("message"));
	String target	= StringUtil.nvl(map.get("target"), "_self");
	String action	= StringUtil.nvl(map.get("action"));


	Enumeration parameterNames = request.getParameterNames();

    String name = "";

    while(parameterNames.hasMoreElements())
    {
        name = (String)parameterNames.nextElement();

		if (name.startsWith("s_")) {
			if (action.indexOf("?") > -1) {
	        	action += "&" + name + "=" + StringUtil.nvl(request.getParameter(name));
			} else {
				action += "?" + name + "=" + StringUtil.nvl(request.getParameter(name));
			}
        }
    }
%>
<html>
<head>
	<title>큐북스</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body>
	<input type="hidden" id="message" name="message" value="<%= message %>" />

	<script language="javascript">
	    if(document.getElementById("message").value != "")
	    {
			alert(document.getElementById("message").value);
	    }

	    if (<%= result %>)
	    {
	<%
			if (target.equals("_opener"))
			{
	%>
				if (opener == undefined || opener == null) {
					document.location.replace("<%= action %>");
				} else {
					opener.document.frm.action = "<%= action %>";
					opener.document.frm.submit();
					self.close()
				}
	<%
			}
			else if (target.equals("_close")) {
	%>
				self.close();
	<%		}
			else
			{
	%>
	            document.location.replace("<%= action %>");
	<%
			}
	%>
		}
		else
		{
			history.back(-1);
		}
	</script>

</body>
</html>
